package project

import (
	"context"
	"gf-assistant/internal/common/factory"
	"gf-assistant/internal/project/parameter"
)

type TaskController struct{ service string }

var Task = TaskController{service: "project.TaskService"}

func GetTaskService() *TaskService {
	return factory.Get(Task.service).(*TaskService)
}

func (c *TaskController) ListTask(ctx context.Context, req *parameter.ListTaskReq) (res *parameter.ListTaskRes, err error) {
	return GetTaskService().ListTask(ctx, req), nil
}
func (c *TaskController) CreateTask(ctx context.Context, req *parameter.CreateTaskReq) (res *parameter.CreateTaskRes, err error) {
	return GetTaskService().CreateTask(ctx, req), nil
}
func (c *TaskController) SaveTask(ctx context.Context, req *parameter.SaveTaskReq) (res *parameter.SaveTaskRes, err error) {
	return GetTaskService().SaveTask(ctx, req), nil
}
func (c *TaskController) DeleteTask(ctx context.Context, req *parameter.DeleteTaskReq) (res *parameter.DeleteTaskRes, err error) {
	return GetTaskService().DeleteTask(ctx, req), nil
}
func (c *TaskController) DistributeTask(ctx context.Context, req *parameter.DistributeTaskReq) (res *parameter.DistributeTaskRes, err error) {
	return GetTaskService().DistributeTask(ctx, req), nil
}
func (c *TaskController) GetTimeLineTask(ctx context.Context, req *parameter.GetTaskTimeLineReq) (res *parameter.GetTaskTimeLineRes, err error) {
	return GetTaskService().GetTimeLineTask(ctx, req), nil
}
func (c *TaskController) GetMyTask(ctx context.Context, req *parameter.MyTaskReq) (res *parameter.MyTaskRes, err error) {
	return GetTaskService().GetMyTask(ctx, req), nil
}
func (c *TaskController) BeginTask(ctx context.Context, req *parameter.BeginTaskReq) (res *parameter.BeginTaskRes, err error) {
	return GetTaskService().BeginTask(ctx, req), nil
}
func (c *TaskController) DoneTask(ctx context.Context, req *parameter.DoneTaskReq) (res *parameter.DoneTaskRes, err error) {
	return GetTaskService().DoneTask(ctx, req), nil
}
